package igou.togogo.controller;

import igou.togogo.pojo.EgouResult;
import igou.togogo.service.ImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/img")
public class ImgController {

    @Autowired
    ImgService imgService;

    @RequestMapping("/main/{product_id}")
    @ResponseBody
    public EgouResult getMainImg(@PathVariable("product_id") Integer productId){
        return imgService.getMainImg(productId);
    }
}
